/// \file examine_kb.cpp.
///============================================================================\n
/// Name        : examine_kb.cpp\n
/// Author      : Gergely Lukacsy (info@dlog-reasoner.org)\n
/// Version     : 0.01\n
/// Copyright   : DERI\n
/// Description : Example for using the DParser library.\n
///
/// This file is part of the DLog 2 project.\n
///============================================================================
#include <iostream>
#include <DParser/dparser_interface.h>

using namespace std;

int main(int argc, char* argv[]) {
	// show help screen if no argument is given
	if (argc == 1) {
		cout << "Example program for demonstrating the usage of the DParser library." << endl;
		cout << "Usage: examine_kb filename" << endl << endl;
		cout << "Please send any comments or suggestions to info@dlog-reasoner.org" << endl;
		return 0;
	}

	// create an SROIQ knowledge base
	SROIQKB* pMyKnowledgeBase = new SROIQKB();

	// read the name of the input ontology file
	char* pFileName = argv[1];

	// construct an OWL parser object, initialize it with my knowledge base
	OWLPARSER parser(pFileName, false, pMyKnowledgeBase);

	// parse the content of the file into pMyKnowledgeBase
	parser.parseOWL();

	// process knowledge base
	// check integrity
	cout << "Number of TBox axioms: " << pMyKnowledgeBase->mTBox.mDisjointAxioms.size() +
										 pMyKnowledgeBase->mTBox.mEquivalenceAxioms.size() +
										 pMyKnowledgeBase->mTBox.mSubsumptionAxioms.size() +
										 pMyKnowledgeBase->mTBox.mKeys.size() << endl;

	cout << "Number of RBox axioms: " << pMyKnowledgeBase->mRBox.mDisjointAxioms.size() +
										 pMyKnowledgeBase->mRBox.mEquivalenceAxioms.size() +
										 pMyKnowledgeBase->mRBox.mSubsumptionAxioms.size() << endl;

	cout << "Number of ABox axioms: " << pMyKnowledgeBase->mABox.mConceptAssertions.size() +
										 pMyKnowledgeBase->mABox.mDifferentInstances.size() +
										 pMyKnowledgeBase->mABox.mRoleAssertions.size() +
										 pMyKnowledgeBase->mABox.mSameInstances.size() << endl;

	// free knowledge base
	delete pMyKnowledgeBase;

	// return
	return 0;
}

